package org.uma.jmetal.util.measure;

/**
 * A {@link PushMeasure} is a {@link Measure} which provides its {@link Value}
 * through notifications. As such, any observer on a {@link PushMeasure} should
 * register a {@link MeasureListener} through {@link #register(MeasureListener)}
 * to specify what to do with the {@link Value} once it is received.
 * 
 * @author Created by Antonio J. Nebro on 21/10/14 based on the ideas of
 *         Matthieu Vergne <matthieu.vergne@gmail.com>
 * 
 * @param <Value>
 *            the type of value the {@link PushMeasure} can provide
 * {@link PushMeasure}是提供其{@link Value}的{@link Measure}
 *通过通知。 因此，{@ link PushMeasure}上的任何观察者都应
  *通过{@link #register（MeasureListener）}注册{@link MeasureListener}
 *指定接收到{@link Value}后该如何处理。
 *
 * @author由Antonio J. Nebro在14/10/21基于
 * Matthieu Vergne <matthieu.vergne@gmail.com>
 *
 * @param <值>
 * {@link PushMeasure}可以提供的值的类型
 */
public interface PushMeasure<Value> extends Measure<Value> {
	/**
	 * Register a {@link MeasureListener} to use the {@link Value}s of the
	 * {@link PushMeasure} when they are generated.
	 * 
	 * @param listener
	 *            the {@link MeasureListener} to register
	 */
	public void register(MeasureListener<Value> listener);

	/**
	 * Unregister a {@link MeasureListener} registered with
	 * {@link #register(MeasureListener)} to stop receiving the notifications of
	 * the {@link PushMeasure}.
	 * 
	 * @param listener
	 *            the {@link MeasureListener} to unregister
	 */
	public void unregister(MeasureListener<Value> listener);
}
